import type { AddressData } from '@/types/address'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAddressStore = defineStore('address', () => {
  // 新的收货地址
  const selectedAddress = ref<AddressData>()

  // 保存新的收货地址
  const changeAddress = (v: AddressData) => {
    selectedAddress.value = v
  }

  return {
    selectedAddress,
    changeAddress,
  }
})
